package com.ycd.controller;

import com.ycd.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("/user")
public class UserController {

    @Value("${server.port}")
    private String port;

    @GetMapping("/add/{id}")
    public User add(@PathVariable("id") Long id){
        Date date = new Date();
        return new User(id,"李飞","今天天气好," +"端口地址"+ port ,date);
    }

}
